package cn.chia.back.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Component;

import cn.chia.back.dao.IOrdertimeDAO;
import cn.chia.pojo.Orders;
import cn.chia.pojo.Ordertime;
@Component
public class OrdertimeDAOImpl extends HibernateDaoSupport implements IOrdertimeDAO {

	@Autowired
	public OrdertimeDAOImpl(HibernateTemplate hibernateTemplate){
		super.setHibernateTemplate(hibernateTemplate);
	}
	
	public void doCreate(Ordertime vo) throws Exception {
		super.getHibernateTemplate().save(vo);
	}

	public void doRemove(Integer id) throws Exception {
		// TODO Auto-generated method stub

	}
	//修改订单时间
	public void doUpdate(Ordertime vo) throws Exception {
		super.getHibernateTemplate().update(vo);
	}
	
	public List<Ordertime> findAll() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Ordertime> findAll(int pageNo, int pageSize, String keyword,
			String column) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
	//根据id查订单时间
	public Ordertime findById(String ordernumber) throws Exception {
		return (Ordertime) super.getHibernateTemplate().find("from Ordertime where ordernumber='"+ordernumber+"'").get(0);
	}

	public int getAllCount(String keyword, String column) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	public Ordertime findById(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
